package c.a.a;

import c.a.a.e0.c;
import java.util.ArrayList;
import java.util.Iterator;

/* compiled from: LottieTask */
public class s implements Runnable {
    public final /* synthetic */ t a;

    public s(t tVar) {
        this.a = tVar;
    }

    public void run() {
        if (this.a.d != null) {
            r rVar = this.a.d;
            Object obj = rVar.a;
            Iterator it;
            if (obj != null) {
                t tVar = this.a;
                synchronized (tVar) {
                    it = new ArrayList(tVar.a).iterator();
                    while (it.hasNext()) {
                        ((n) it.next()).onResult(obj);
                    }
                }
            } else {
                t tVar2 = this.a;
                Throwable th = rVar.b;
                synchronized (tVar2) {
                    ArrayList arrayList = new ArrayList(tVar2.b);
                    if (arrayList.isEmpty()) {
                        c.c("Lottie encountered an error but no failure listener was added:", th);
                    } else {
                        it = arrayList.iterator();
                        while (it.hasNext()) {
                            ((n) it.next()).onResult(th);
                        }
                    }
                }
            }
        }
    }
}
